import request from '@/utils/request'
import axios from 'axios';
import baseURL from '@/utils/baseURL'

export default {
  //bug
  bugsList(data = {}) {
    return request({
      url: '/zentao/bugsList',
      method: 'post',
      data
    })
  },
  //bug明细
  bugDeatilList(data = {}) {
    return request({
      url: '/zentao/bugDeatilList',
      method: 'post',
      data
    })
  },
  //工时
  effortsList(data = {}) {
    return request({
      url: '/zentao/effortsList',
      method: 'post',
      data
    })
  },
  //任务
  tasksList(data = {}) {
    return request({
      url: '/zentao/tasksList',
      method: 'post',
      data
    })
  },
  //执行汇总（项目）
  executionsList(data = {}) {
    return request({
      url: '/zentao/executionsList',
      method: 'post',
      data
    })
  },
  //BUG统计
  bugsProject(data = {}) {
    return request({
      url: '/zentao/bugsProject',
      method: 'post',
      data
    })
  },

  //任务
  tasksListAll(data = {}) {
    return request({
      url: '/zentao/tasksListAll',
      method: 'post',
      data
    })
  },
  executionsListAll(data = {}) {
    return request({
      url: '/zentao/executionsListAll',
      method: 'post',
      data
    })
  },

  // 导出
  //bug
  bugsExport(data = {}) {
    return axios({
      url: `${baseURL.webUrl}/zentao/bugs`,
      method: 'post',
      responseType: 'blob',
      data,
    });
  },
  //bug明细
  bugDeatilExport(data = {}) {
    return axios({
      url: `${baseURL.webUrl}/zentao/bugDeatil`,
      method: 'post',
      responseType: 'blob',
      data,
    });
  },
  //工时
  effortsExport(data = {}) {
    return axios({
      url: `${baseURL.webUrl}/zentao/efforts`,
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  //任务
  tasksExport(data = {}) {
    return axios({
      url: `${baseURL.webUrl}/zentao/tasks`,
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  //执行汇总（项目）
  executionsExport(data = {}) {
    return axios({
      url: `${baseURL.webUrl}/zentao/executions`,
      method: 'post',
      responseType: 'blob',
      data
    })
  },
}
